<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activId']))
{
  header("location:checklogin.php");
}

$deleteLoading = "DELETE FROM loadinginvoice
                   WHERE loadingInvoiceId = ".$_GET['loadingInvoiceId'];
$deleteLoadingRes = mysql_query($deleteLoading);
if(!$deleteLoadingRes)
{
	echo("DELETE FAIL Master");
}
else
{
	$deleteLoadingDetail = "DELETE FROM loadinginvoicedetail
	                         WHERE loadingInvoiceId = ".$_GET['loadingInvoiceId'];
	$deleteLoadingDetailRes = mysql_query($deleteLoadingDetail);
	if(!$deleteLoadingRes)
	{
		echo("DELETE FAIL Detail");
	}
	else
	{
	  header("Location:loadinginvoice.php");
	}
}
?>